< previous page page_318 next page >

Page 318
Completing an ODBC registration inserts data into the HKEY_USERS\DEFAULT\ODBC\ODBC.INI section of the Windows Registry on 32-bit systems. The data is added to the ODBC.INI file in the <WINDOWS> folder on 16-bit systems. You can add features to the earlier cmdDBRegister_Click example by prompting the user to enter the SourceName and DriverName. You could also fill out all values within the program and set the SilentFlag to True. In this way, you could use the routine to install new ODBC connections for Visual Basic applications without requiring the user to know anything at all about ODBC or Microsoft Jet.
warning.gif
Failure to register an ODBC data source properly can result in un-expected errors and possible loss of data. Be sure to test your RegisterDatabase routines completely before using them on live data.

The SetOption Method
The SetOption method of the DBEngine object allows you to override performance values in the Registry at runtime. You can use this option to perform runtime tuning of the Microsoft Jet engine. Table 9.1 shows the values you can adjust using the SetOption method.
Table 9.1. Tuning values for the SetOption method of the DBEngine.
ConstantDescription
dbPageTimeoutPageTimeout key
dbSharedAsyncDelaySharedAsyncDelay key
dbExclusiveAsyncDelayExclusiveAsyncDelay key
dbLockRetryLockRetry key
dbUserCommitSyncUserCommitSync key
dbImplicitCommitSyncImplicitCommitSync key
dbMaxBufferSizeMaxBufferSize key
dbMaxLocksPerFileMaxLocksPerFile key
dbLockDelayLockDelay key
dbRecycleLVsRecycleLVs key
dbFlushTransactionTimeoutFlushTransactionTimeout key

 
< previous page page_318 next page >

If you like this book, buy it!